package com.jingdianjichi.subject.common.enums;

import lombok.Getter;

/**
 * 题目类型枚举
 */
@Getter
public enum SubjectInfoTypeEnum {
    RADID(1,"单选"),
    MULTIPLE(2,"多选"),
    JUDGE(3,"判断"),
    BRIEF(4,"简答");

    private int code;
    private String desc;

    SubjectInfoTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }


    //根据code找到枚举
    public static SubjectInfoTypeEnum getByCode(int codeVal){
        for (SubjectInfoTypeEnum CodeEnum: SubjectInfoTypeEnum.values()){
            if (CodeEnum.code == codeVal){
                return CodeEnum;
            }
        }

        return null;
    }
}
